package com.example.domain.repository;

import com.example.domain.entity.OrderItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * 订单明细Repository
 * 
 * <p><strong>注意：订单功能暂未开发，所有自定义方法已注释</strong></p>
 * 
 * @author Means
 * @since 2025-10-27
 */
@Repository
public interface OrderItemRepository extends JpaRepository<OrderItem, String> {
    
    // ==================== 订单功能暂未开发，所有自定义方法已移除 ====================
    
    /*
     * TODO: 订单功能开发计划
     * 
     * 待实现的自定义查询方法包括：
     * 
     * 基础查询：
     * - List<OrderItem> findByIsDeleted(Boolean isDeleted)
     * - List<OrderItem> findByOrderIdAndIsDeleted(String orderId, Boolean isDeleted)
     * - List<OrderItem> findByProductIdAndIsDeleted(String productId, Boolean isDeleted)
     * - Optional<OrderItem> findByOrderIdAndProductIdAndIsDeleted(...)
     * - List<OrderItem> findByBaseUnitAndIsDeleted(String baseUnit, Boolean isDeleted)
     * 
     * 批量查询：
     * - List<OrderItem> findByOrderIds(@Param("orderIds") List<String> orderIds, ...)
     * - List<OrderItem> findByProductIds(@Param("productIds") List<String> productIds, ...)
     * 
     * 分页查询：
     * - Page<OrderItem> findByOrderIdAndIsDeleted(String orderId, Boolean isDeleted, Pageable pageable)
     * - Page<OrderItem> findByProductIdAndIsDeleted(String productId, Boolean isDeleted, Pageable pageable)
     * 
     * 时间范围查询：
     * - List<OrderItem> findByProductIdAndTimeRange(...)
     * 
     * 统计查询：
     * - Long countByOrderIdAndIsDeleted(String orderId, Boolean isDeleted)
     * - Long countByProductIdAndIsDeleted(String productId, Boolean isDeleted)
     * - BigDecimal sumLineAfterDiscountByOrderId(...)
     * - BigDecimal sumLineBeforeDiscountByOrderId(...)
     * - BigDecimal sumNormalizedQuantityByProductId(...)
     * - BigDecimal sumSalesAmountByProductIdAndTimeRange(...)
     * 
     * 自定义查询：
     * - Optional<OrderItem> findByIdAndNotDeleted(@Param("id") String id)
     * - List<String> findProductIdsByOrderId(...)
     * - Page<Object[]> findTopSellingProducts(...)
     * 
     * 注意：JpaRepository 提供的基础方法（save, findById, findAll, delete等）仍然可用
     */
}
